from django.urls import path
from rest_framework.routers import SimpleRouter
from apps.study.views import StudentViewSet, ClassesViewSet

urlpatterns=[
    # path('student/',StudentViewSet.as_view({'get':'list','post':'create'})), # 查一组
    # path('student/<pk>/',StudentViewSet.as_view({'get':'retrieve','put':'update','delete':'destroy'}))

]
router=SimpleRouter() #实例化路由器
router.register('student',StudentViewSet) # 注册路由
router.register('classes',ClassesViewSet) # 注册路由
urlpatterns +=router.urls #获取生成的路由列表
